<style>
    .validform input,select {
        width: 60%;
        float: left;
    }
    .validform select {
        width: 60%;
        float: left;
    }
</style>
<form  method="post"   class="form-horizontal validform" id="cpform" name="cpform" role="form" autocomplete='off'>
    <input type='hidden' name='uid' value="{{$item['uid']}}" />
    <ul id="myTab" class="nav nav-tabs">
        <li class="active"><a href="#base" data-toggle="tab">基本资料</a></li>
        <li><a href="#link" data-toggle="tab">联系方式</a></li>
        <li><a href="#edu" data-toggle="tab">教育情况</a></li>
        <li><a href="#work" data-toggle="tab">工作情况</a></li>
        <li><a href="#info" data-toggle="tab">个人信息</a></li>
    </ul>
    <div id="myTabContent" class="tab-content">
        <div class="tab-pane fade in active" id="base"><br>
            <table class="table table-border ticky_table">
                <tr>
                    <td class="w_100">{{L('member_username')}}</td>
                    <td>{{$item.username}}</td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_realname')}}</td>
                    <td><input type="text" id="realname" name='realname' value="{{$item.realname}}" maxlength="255" tabindex="2" class='form-control' datatype = "empty|zh" /></td>
                </tr>
                <tr>
                    <td class="w_100"> {{L('memberprofile_gender')}}</td>
                    <td class="form-inline">
                        {{form::select('gender',$item.gender,array('保密', '男', '女'))}}
                    </td>
                </tr>
                <tr>
                    <td class="w_100"> 生日</td>
                    <td  class="form-inline">
                        <select id="birthyear" name="birthyear" onchange="showbirthday();" class="form-control">
                            <option value="0">年</option>
                            {{$birthyeayhtml}}
                        </select>
                        <select id="birthmonth" name="birthmonth" onchange="showbirthday();" class="form-control">
                            <option value="0">月</option>
                            {{$birthmonthhtml}}
                        </select>
                        <select id="birthday" name="birthday" class="form-control">
                            <option value="0">日</option>
                            {{$birthdayhtml}}
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_birthprovince')}}</td>
                    <td  class="form-inline">
                        <input type="hidden" name="area" value="||" id="area">
                        <select id="birthprovince" name="birthprovince" class="form-control w_300"></select>
                        <select id="birthcity" name="birthcity" class="form-control w_300"></select>
                        <select id="birthdist"  name="birthdist" class="form-control w_300"></select>
                    </td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_birthcommunity')}}</td>
                    <td >
                        <input type="text" id="birthcommunity" name='birthcommunity' value="{{$item.birthcommunity}}" maxlength="255" tabindex="17" class='form-control'  />
                    </td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_resideprovince')}}</td>
                    <td>
                        <div  class="form-inline">
                            <select id="resideprovince" name="resideprovince" class="form-control w_300"></select>
                            <select id="residecity" name="residecity" class="form-control w_300"></select>
                            <select id="residedist"  name="residedist" class="form-control w_300"></select>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_residecommunity')}}</td>
                    <td>
                        <div>
                            <input type="text" id="residecommunity" name='residecommunity' value="{{$item.residecommunity}}" maxlength="255" tabindex="21" class='form-control'  />

                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div class="tab-pane fade" id="link"><br>
            <table class="table table-border ticky_table">
                <tr>
                    <td class="w_100">{{L('member_email')}}</td>
                    <td>{{$item.email}}</td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_alipay')}}</td>
                    <td><input type="text" id="alipay" name='alipay' value="{{$item.alipay}}" maxlength="255" tabindex="28" class='form-control' /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_qq')}}</td>
                    <td><input type="text" id="qq" name='qq' value="{{$item.qq}}" maxlength="255" tabindex="28" class='form-control' datatype = "empty|qq" /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_icq')}}</td>
                    <td><input type="text" id="icq" name='icq' value="{{$item.icq}}" maxlength="255" tabindex="35" class='form-control' /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_taobao')}}</td>
                    <td><input type="text" id="taobao" name='taobao' value="{{$item.taobao}}" maxlength="255" tabindex="35" class='form-control' /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_msn')}}</td>
                    <td><input type="text" id="msn" name='msn' value="{{$item.msn}}" maxlength="255" tabindex="35" class='form-control' /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_yahoo')}}</td>
                    <td><input type="text" id="yahoo" name='yahoo' value="{{$item.yahoo}}" maxlength="255" tabindex="37" class='form-control' /></td>
                </tr>
            </table>
        </div>
        <div class="tab-pane fade" id="edu"><br>
            <table class="table table-border ticky_table">
                <tr>
                    <td class="w_100">{{L('memberprofile_graduateschool')}}</td>
                    <td><input type="text" id="graduateschool" name='graduateschool' value="{{$item.graduateschool}}" maxlength="255" tabindex="23" class='form-control' /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_education')}}</td>
                    <td>
                        {{form::select('education',$item.education,array('博士', '硕士', '本科', '专科', '中学', '小学', '其它'))}}
                    </td>
                </tr>
            </table>
        </div>
        <div class="tab-pane fade" id="work"><br>
            <table class="table table-border ticky_table">

                <tr>
                    <td class="w_100">{{L('memberprofile_company')}}</td>
                    <td><input type="text" id="company" name='company' value="{{$item.company}}" maxlength="255" tabindex="24" class='form-control' /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_occupation')}}</td>
                    <td><input type="text" id="occupation" name='occupation' value="{{$item.occupation}}" maxlength="255" tabindex="26" class='form-control' /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_position')}}</td>
                    <td><input type="text" id="position" name='position' value="{{$item.position}}" maxlength="255" tabindex="27" class='form-control' /></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_revenue')}}</td>
                    <td><input type="text" id="revenue" name='revenue' value="{{$item.revenue}}" maxlength="255" tabindex="28" class='form-control' /></td>
                </tr>
            </table>
        </div>
        <div class="tab-pane fade" id="info"><br>
            <table class="table table-border ticky_table">
                <tr>
                    <td class="w_100">{{L('memberprofile_idcard')}}</td>
                    <td  class="form-inline">
                        {{form::select('id="idcardtype"  name="idcardtype"  datatype="*"',$item.idcardtype,array('身份证', '护照', '军官证'),$item.idcardtype)}}
                        <input type="text" id="idcard" name='idcard' value="{{$item.idcard}}" maxlength="255" tabindex="10" class='form-control' onblur="checkCard()"  style="width: 500px;"/></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_address')}}</td>
                    <td class="form-inline">
                        <input type="text" id="address" name='address' value="{{$item.address}}" maxlength="255" tabindex="11" class='form-control'  style="width: 500px;"/>
                        <input type="text" id="zipcode" name='zipcode' value="{{$item.zipcode}}" maxlength="255" tabindex="12" class='form-control'  style="width: 100px;"placeholder="{{L('memberprofile_zipcode')}}" />
                    </td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_site')}}</td>
                    <td><input type="text" id="site" name='site' value="{{$item.site}}" maxlength="255" tabindex="40" class='form-control'/></td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_bio')}}</td>
                    <td>
                        <textarea  id="bio" name='bio' class="form-control" rows="3"  style="width: 100%;">{{$item.bio}}</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="w_100">{{L('memberprofile_interest')}}</td>
                    <td>
                        <textarea  id="interest" name='interest' class="form-control" rows="3" style="width: 100%;">{{$item.interest}}</textarea>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <input type='submit' name='dosubmit' class='btn btn-primary' value='提交' style="width: 54px;" />
        </div>
    </div>
    <script type="text/javascript">
        addressInit('birthprovince', 'birthcity', 'birthdist', '{{$item.birthprovince}}', '{{$item.birthcity}}', '{{$item.birthdist}}');
        addressInit('resideprovince', 'residecity', 'residedist', '{{$item.resideprovince}}', '{{$item.residecity}}', '{{$item.residedist}}');
        $(function () {
            $(".validform").Validform({tiptype: 3, showAllError: true});
        });
        function checkCard() { // onblur="checkCard()"
            var idcardType = $("#idcardtype").val();
            var idcard = document.getElementById("idcard");
            console.log(idcardType);
            if (idcardType == "0") {
                if (checkIdCardNo(idcard) == false) {
                    if (message.length > 0) {
                        $("#idcard").addClass("Validform_error");
                        $.Showmsg("输入的身份证号码错误");
                        return false;
                    } else {
                        $("#idcard").removeClass("Validform_error");
                        message = "";
                        return true;
                    }
                } else {
                    $("#idcard").removeClass("Validform_error");
                    message = "";
                    return true;
                }
            } else {
                $("#idcard").removeClass("Validform_error");
                message = "";
                return true;
            }
        }
    </script>
</form>